#include <QtTriggerEditorManager.h>


QtTriggerEditorManager::QtTriggerEditorManager(QObject *parent /*= 0*/ ) : QtAbstractPropertyManager(parent)
{

}

QtTriggerEditorManager::~QtTriggerEditorManager()
{

}

QVarintTrigger QtTriggerEditorManager::value(QtProperty *property_ptr)
{
    if (!m_propertyPtrToData.contains(property_ptr))
        return QVarintTrigger();
    return m_propertyPtrToData[property_ptr];

}

void QtTriggerEditorManager::setValue(QtProperty *property_ptr, const QVarintTrigger &value_trigger)
{
    if (!m_propertyPtrToData.contains(property_ptr))
        return;
    m_propertyPtrToData[property_ptr] = value_trigger;
    //emit propertyChanged (property_ptr);
    //emit valueChanged(property_ptr,value_trigger);
}

void QtTriggerEditorManager::setValueByButton(QtProperty *property_ptr)
{
    emit valueChanged(property_ptr,QVarintTrigger());

}

void QtTriggerEditorManager::initializeProperty(QtProperty *property)
{
    m_propertyPtrToData[property] = QVarintTrigger();
}

QString QtTriggerEditorManager::valueText(const QtProperty *property) const
{
    if (!m_propertyPtrToData.contains(property))
        return "";
    return "trigger";//m_propertyPtrToData[property].value.toString()
}
#include "moc_QtTriggerEditorManager.cxx"

